package com.qf.aop;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.springframework.aop.MethodBeforeAdvice;

import java.lang.reflect.Method;

public class MyMethodBeforeAdvice implements MethodInterceptor {

    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {
        System.out.println("环绕通知: 开始辅助内容tx begin~~");
        Object ret = invocation.proceed();// 触发，执行核心功能
        System.out.println("环绕通知: 结尾复制内容tx end!!");
        return ret;
    }
}
